﻿using System.ComponentModel;
using System.Windows;
using Arch.Model;

namespace Arch.Client.Infrastructure
{
    public class ViewModelBase : ModelObject
    {
#if !SILVERLIGHT
        private static bool? _isInDesignMode;

        public bool IsInDesignMode
        {
            get
            {
                return IsInDesignModeStatic;
            }
        }

        public static bool IsInDesignModeStatic
        {
            get
            {
                if (!_isInDesignMode.HasValue)
                {
                    _isInDesignMode = new bool?(DesignerProperties.GetIsInDesignMode(Application.Current.MainWindow));
                }
                return _isInDesignMode.Value;
            }
        }
#endif
    }
}